import request from '@/utils/request'

/**
 * 新增优惠券
 */
export function addCoupon(coupon) {
    return request({
        url: '/coupon/addCoupon',
        method: 'post',
        data: coupon
    })
}

/**
 * 设置优惠券领取状态
 */
export function changeCouponState(couponId, couponState) {
    return request({
        url: '/coupon/changeCouponState',
        method: 'post',
        params: {couponId: couponId, couponState: couponState}
    })
}

/**
 * 获取优惠券列表
 */
export function getCouponList(pageNo, size) {
    return request(({
        url: '/coupon/couponListPage',
        method: 'get',
        params: {pageNo: pageNo, size: size}
    }))
}
